package com.xy.test;

import java.io.*;

public class NormalCopy {
    public static void main(String[] args) throws IOException {
        File fileA = new File("/home/x/mydisk.img");
        File fileB = new File("/home/x/temp/mydisk.img");
        FileInputStream fileInputStream = new FileInputStream(fileA);
        FileOutputStream fileOutputStream = new FileOutputStream(fileB);
        int size;
        byte[] buffer = new byte[1024];
        while ((size = fileInputStream.read(buffer)) != -1) {
            fileOutputStream.write(buffer, 0, size);
        }
    }
}
